import axios from '@/utils/request'

import config from '@/common/config'

let base = config.getMkBasePath();


/**
 * mem_grade
 *1    默认只开放普通查询，所有查询，只要上传	 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】}，后台都会自动按分页查询 其它 api用到再打开，没用到的api请注释掉，
 *2 查询、新增、修改的参数格式  params={gradeId:'等级ID 主键',gradeName:'等级名称',gradeDesc:'等级描述',branchId:'公司ID',gradeLevel:'1-粉丝,2-',rebate:'权益，折扣',editStatus:'是否可编辑:0-不可编辑',gradeStatus:'等级状态',createTime:'create_time',updateTime:'update_time',gradePicUrl:'等级图标url',gradePicPath:'等级图标路径',foreignLevel:'外部系统会员等级',isFree:'是否付费',changeCard:'升级是否换卡号',continueTimeRule:'续会时间叠加规则：1.有效期日期后叠加续会时间',continueTimeType:'续会时间类型：1.天数',continueTime:'续会时间',backgroundPicUrl:'会员卡背景图标url',backgroundPicPath:'会员卡背景图标路径',upgradeContition:'升级条件',continueContition:'续会条件（0：或',continueType:'续会功能',gradeType:'等级分类',rebateType:'权益类型',shopId:'商户编号'}
 **/
 
//普通查询 条件之间and关系  
export const listMemGrade = params => { return axios.get(`${base}/mk/mem/grade/list`, { params: params }); };

//模糊查询mem_grade 条件之间or关系  
//export const listMemGradeKey = params => { return axios.get(`${base}/mk/mem/grade/listKey`, { params: params }); };

//删除一条mem_grade params={gradeId:'等级ID 主键'}
export const delMemGrade = params => { return axios.post(`${base}/mk/mem/grade/del`,params); };

//批量删除mem_grade  params=[{gradeId:'等级ID 主键'}]
export const batchDelMemGrade = params => { return axios.post(`${base}/mk/mem/grade/batchDel`, params); };

//修改一条mem_grade记录
export const editMemGrade = params => { return axios.post(`${base}/mk/mem/grade/edit`, params); };

//新增一条mem_grade
export const addMemGrade = params => { return axios.post(`${base}/mk/mem/grade/add`, params); };